/**
 * Book路由模块
 */

var express = require('express');
var router = express.Router();

//导入所需控制
const bookshelf = require("../controller/bookshelf");

const auth = require("../controller/auth")
//守卫路由
router.all("*",auth.isLogin)
//更新阅读状态
router.patch("/read-status/:id",bookshelf.updateReadStatus)
//更新评分
router.patch("/ranking/:id",bookshelf.updateRanking)

//获取总数
router.get("/count",bookshelf.getCount);

router.get("/:id",bookshelf.find);

router.get("/",bookshelf.findAll);

router.post("/",bookshelf.add);

router.put("/:id",bookshelf.update);

router.delete("/:id",bookshelf.remove);



module.exports = router;